<%
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
%>

<% page_comment ||= nil; comment = page_comment || nil; read_only ||= false %>
<div class="comment" id="comment_<%= comment ? comment.id : "{{ blank }}" %>" style="<%= hidden unless comment %> border: 0px solid #aaa; margin-bottom: 10px;">
  <div style="float: left;" class="user_name"><%= comment.user_name rescue nbsp %></div>
  <div style="float: right;">
    <span class="created_at" style="color: #888; font-size: 0.8em;"><%= datetime_string(comment.created_at) rescue nbsp %></span>
    <% if !read_only && can_do(@portfolio, @current_user, :update) %>
      <a href="<%= eportfolio_entry_page_comment_path(@portfolio.id, @page.id, comment ? comment.id : "{{ id }}") %>" class="delete_comment_link no-hover">{{> icons/trash}}</a>
    <% end %>
  </div>
  <div class="clear" style="border-top: 1px solid #ccc;"></div>
  <div class="message message-eportfolios"><%= comment.message rescue nbsp %></div>
</div>
